Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@refinitiv-ui/core

Package Overview
Dependencies
Maintainers
2
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@refinitiv-ui/core

Element Framework Core

  • 5.4.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Core Components for Element Framework

Core functionality for building Element Framework elements, it exports the following classes:

Basic Element

A base class for extending simple element that have minimal functionality.

import { BasicElement, customElement } from '@refinitiv-ui/core';

@customElement('my-avatar')
class MyAvatar extends BasicElement {
  ...
}

Control Element

A base class for extending control element, usually referred to as form elements. These controls have additional functionality, such as, disabled and read-only states.

import { ControlElement, customElement } from '@refinitiv-ui/core';

@customElement('my-button')
class MyButton extends ControlElement {
  ...
}

Responsive Element

A base class for extending element which needs to respond to their dimensions e.g data visualizations. The base class provides resize observer callback which will trigger whenever that the element's dimensions are changed.

import { ResponsiveElement, customElement } from '@refinitiv-ui/core';

@customElement('my-chart')
class MyChart extends ResponsiveElement {
  ...
}

Helper for Deprecation Notices

The core provides a way of showing uniform deprecation notices, when deprecated features are used in elements.

import { BasicElement, DeprecationNotice } from '@refinitiv-ui/core';

class MyElement extends BasicElement {

  private deprecationNotice = new DeprecationNotice(
    'The feature of hopping has be replaced by skipping. Please update to use the latest API.',
    'https://a.support.link'
  )

  private showDeprecationNotice () {
    // you can some logic to check if deprecated features are being used
    if (!this.deprecationNotice.shown && deprecatedFeatureUsed) {
      this.deprecationNotice.show();
    }
  }

}

Error Handling

All errors handling in the core should use the GenericError class. Also, where possible, you should provide an additional support URL. Additional error types can be added to ./src/errors/.

import { GenericError } from './src/errors/GenericError';

throw new GenericError(
  // Message
  'Something has gone wrong',
  // Support URL
  'https://support/error/something'
);

FAQs

Package last updated on 15 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc